package com.bytedance.common.b;

import android.annotation.TargetApi;
import android.app.ActivityManager;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.view.View;

public final class f {
    static class a {
        a(byte arg1) {
            this();
        }

        private a() {

        }

        public long a(ActivityManager.MemoryInfo arg3) {
            return 0;
        }

        public void a(View arg1, Drawable arg2) {
            arg1.setBackgroundDrawable(arg2);
        }
    }

    @TargetApi(value = 16)
    static final class b extends a {
        b(byte arg1) {
            this();
        }

        private b() {
            super((byte) 0);
        }

        public final long a(ActivityManager.MemoryInfo arg3) {
            return arg3.totalMem;
        }

        public final void a(View arg2, Drawable arg3) {
            try {
                arg2.setBackground(arg3);
            } catch (Throwable v0) {
                arg2.setBackgroundDrawable(arg3);
            }
        }
    }

    private static a a;

    static {
        f.a = Build.VERSION.SDK_INT >= 16 ? new b((byte) 0) : new a((byte) 0);
    }

    public static void a(View arg1, Drawable arg2) {
        f.a.a(arg1, arg2);
    }

    public static long a(ActivityManager.MemoryInfo arg2) {
        return f.a.a(arg2);
    }
}

